package com.openbravo.pos.inventory;

import com.openbravo.basic.BasicException;
import com.openbravo.data.user.BrowsableData;
import com.openbravo.format.Formats;
import javax.swing.table.AbstractTableModel;

public class StockModel extends AbstractTableModel
{
  private BrowsableData m_bd;
  private Formats[] m_formats;
  private boolean[] m_bedit;

  public StockModel(BrowsableData paramBrowsableData, Formats[] paramArrayOfFormats, boolean[] paramArrayOfBoolean)
  {
    this.m_bd = paramBrowsableData;
    this.m_formats = paramArrayOfFormats;
    this.m_bedit = paramArrayOfBoolean;
  }

  public int getRowCount()
  {
    return this.m_bd.getSize();
  }

  public int getColumnCount()
  {
    return this.m_formats.length;
  }

  public Object getValueAt(int paramInt1, int paramInt2)
  {
    return this.m_formats[paramInt2].formatValue(((Object[])(Object[])this.m_bd.getElementAt(paramInt1))[paramInt2]);
  }

  public boolean isCellEditable(int paramInt1, int paramInt2)
  {
    return this.m_bedit[paramInt2];
  }

  public void setValueAt(Object paramObject, int paramInt1, int paramInt2)
  {
    Object[] arrayOfObject = (Object[])(Object[])this.m_bd.getElementAt(paramInt1);
    try
    {
      arrayOfObject[paramInt2] = this.m_formats[paramInt2].parseValue((String)paramObject);
      this.m_bd.updateRecord(paramInt1, arrayOfObject);
    }
    catch (BasicException localBasicException)
    {
    }
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.inventory.StockModel
 * JD-Core Version:    0.6.0
 */